<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const p1 =() =>{
            new Promise((resvole,reject)=>{
                setTimeout(()=>{
                    console.log('1');
                    resvole('1')
                },1000)
            } )
        }
        const p2 =() =>{
            new Promise((resvole,reject)=>{
                setTimeout(()=>{
                    console.log('2');
                    resvole('2')
                },500)
            } )
        }
        const p3 =() =>{
            new Promise((resvole,reject)=>{
                setTimeout(()=>{
                    console.log('3');
                    resvole('3')
                },1200)
            } )
        }

        p1()
        .then((res) =>{
            console.log('p1 res',res);
            return p2()
        })
        .then((res) =>{
            console.log('p2 res',res);
            return p3()
        })
        .then((res) =>{
            console.log('p3 res',res);
        }) 
            
        


    </script>
</body>
</html>